<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="down2.*" %>
<%@ page import="java.net.URLDecoder" %>
<%@ page import="org.apache.commons.lang.*" %>
<%@ page import="java.io.*" %>
<% out.clear();
/*
	更新文件进度信息
	更新记录：
		2012-05-24 完善
		2012-06-29 增加创建文件逻辑，
*/
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

String fid 		= request.getParameter("id");
String uid 		= request.getParameter("uid");
String per		= request.getParameter("perLoc");
String lenLoc	= request.getParameter("lenLoc");
String lenSvr	= request.getParameter("lenSvr");
String sizeSvr	= request.getParameter("sizeSvr");
String nameLoc	= request.getParameter("nameLoc");
String pathLoc	= request.getParameter("pathLoc");
nameLoc 		= nameLoc.replaceAll("\\+","%20");
nameLoc			= URLDecoder.decode(nameLoc,"UTF-8");//utf-8解码 
pathLoc 		= pathLoc.replaceAll("\\+","%20");
pathLoc			= URLDecoder.decode(pathLoc,"UTF-8");//utf-8解码
String cbk 		= request.getParameter("callback");//jsonp

if (StringUtils.isBlank(uid)
	||StringUtils.isBlank(fid)
	||StringUtils.isBlank(cbk))
{
	out.write(cbk+"({\"value\":null})");
	return;
}

if (StringUtils.isBlank(lenLoc)) lenLoc = "0";
if (StringUtils.isBlank(lenSvr)) lenSvr = "0";

DBConfig cfg = new DBConfig();
cfg.db().update(fid,Integer.parseInt(uid),lenLoc,per,nameLoc,pathLoc,lenSvr,sizeSvr);
out.write(cbk + "({\"value\":1})");%>